<?php
/**
 * Created by PhpStorm.
 * Author: sitenv@aliyun.com
 * CreateTime: 2021/07/10 16:47
 * Blog：www.myblogs.xyz
 */

namespace app\admin\controller;


use app\BaseController;
use app\common\service\LoginService;
use think\facade\View;

class Login extends BaseController
{
    public function index()
    {
        View::config(['layout_on'=>false]);
        // Get background Settings
        $setting_model = new \app\common\model\Setting();
        $site = $setting_model->settingFind('site');
        View::assign([
            'site'=>$site
        ]);
        return View::fetch();
    }

    public function into()
    {
        LoginService::into();
    }

    public function out()
    {
        session('admin_id', null);
        session('admin_data', null);
        return redirect(url('/Login/index'));
    }
}